Repository navigation
fix: 17 audit fixes across feeds, swipe, offline app, comments and autolinking - #358
Merged
Merged
Conversation
A list restored from the cache was saved to the session on the way out even when it was never refreshed. Coming back restored it as current, so it skipped the refresh and its next page repeated the front page. Clear the session state instead, so returning refreshes it like a fresh visit.
The injected story was compared to the first story by reference. Once the feed loaded its own copy of the anchored story, the check missed and the linked story was spliced in twice, with duplicate React keys. Compare by id.
A new touch during any running animation restored the panel and its saved scroll, but only an interrupted commit needs that. A snap-back leaves the panel in place, and its scroll was never saved, so the page jumped to the top. Track whether the running animation is a commit.
…its bundles A 5xx from Pages won the navigation race and replaced a working app with an error page; it now counts as a network failure. The offline shell was also replaced as soon as new HTML arrived, before its hashed bundles were cached, so a failed bundle download left a shell that opened to a blank screen offline. Cache the bundles first, then swap the shell. Also correct two comments about Pages and the timeout path.
HN leaves the first paragraph as a bare text node (first<p>second), so the p + p rule never spaced the first break. Give every p a top margin instead. The e2e mock comment now uses HN's real markup.
Expanding or collapsing replies unmounted the pressed button and dropped focus to <body>. When the button had focus, move it to the button that replaces it.
Comments that hadn't loaded yet rendered as an empty tree, which says "No comments yet." Screen readers and reduced-motion users, who get no skeleton overlay, saw it on every story.
…otes The email branch retried from every character of a long token with no @, which is quadratic: a 60k-character hash froze the page for seconds. Start a local part only where one can start. Also stop linking an address followed by :path, such as git@github.com:user/repo.git.
Some dead stories (item 28) report descendants: -1, shown as -1 comments.
A query search can return empty pages before its estimated nbPages (x.com: pages 9 and 10 of 11). The last page then had no hit to restart from, so the feed ended early (425 of 457 x.com stories). Carry the oldest hit so far in the cursor and restart from it after an empty last page.
The mobile wrapper checked the raw route param, so a domain that canonicalizes to nothing mounted an empty swipe viewer instead of the "No domain specified" state desktop shows.
A panel that turns deferred keeps its fetch running, which holds the priority slot until it settles. The deferred effect had no cleanup, so a panel unmounted with that fetch stalled blocked prefetching until the request settled, possibly never.
The runtime cache is FIFO-trimmed to 64 entries, but cache hits never rewrite an entry, so chunks that rarely change (the rolldown runtime, inserted at install right after the index bundle) stay the oldest. Once enough deploys fill the cache, the next trim evicts a bundle the cached shell still needs and the next offline launch is a blank screen. This predates this branch; it is reachable after roughly 6-12 months of regular releases. trimCache now skips the cached offline shell's bundles, and when a new shell is adopted, the new shell's bundles too, so the old shell stays a working fallback until it is replaced. The cache layout is unchanged, so VERSION stays as is.
A release that changes sw.js installs the new worker into the same hackertok-shell cache the running one boots from. Install used to addAll() the new index.html first and precache its bundles best-effort afterwards, so a dropped bundle download left a shell whose bundles weren't cached: the next offline launch was a blank screen. This is already on main, and sw.js hasn't changed since v1.0.0, so this release is the first time installed clients run the update install. Install now fetches the precache into memory, caches the shell's bundles through cacheShellAssets (the navigation-refresh path), and only then writes the new shell. If the bundles fail, an update keeps the cached shell; a first install has none to keep, so it caches this one and leaves the bundles to runtime caching, as before. Install also drops its own copy of the asset regex. cacheShellAssets now checks this version's runtime cache only. During a VERSION bump's install the old caches still hold the bundles, so a global caches.match() skipped them, and activate then deleted them. The new spec serves dist/ from an in-test server, because context.route() can't intercept the browser's sw.js update fetch. It blocks external hosts by DNS rather than mocking the HN APIs, because Playwright's route interception intermittently keeps the old worker from handing over.
…mails The scp-remote guard let the domain backtrack, so git@gitlab.example.com:u/r.git linked mailto:git@gitlab.example. The local-part guard also stopped linking --name@gmail.com and _foo@bar.com, which main linked as name@ / foo@.
… shell With GitHub Pages' max-age=600, the navigation fetch could return a just-deployed index.html from the HTTP cache while offline. If that build's bundles never downloaded, the app booted blank instead of falling back to the cached shell.
therealsama
enabled auto-merge
November 29, 2026 21:02
kplachkov
approved these changes
Nov 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes 17 bugs found in an audit. Each fix has a regression test that fails without it.
What changed
Feed and swipe viewer
Offline app (service worker)
main.main.main, this breaks the offline app after enough releases.Comments
Text and data
git@github.com:user/repo.gitaren't linked as emails.-1).#/from/.shows "No domain specified" on phones too.Testing
npm run typecheck: passednpm run lint: passednpm run test:run: passed, 1047 tests (was 1035)npm run build: passednpm run e2e -- --project=chromium --project="Mobile Chrome": 433 passed, 9 skipped (442 tests, was 424)e2e/pwa-update.spec.tsservesdist/from its own server and blocks external hosts, because Playwright's route mocks intermittently stall service worker updates.Known limitations and follow-ups
aria-labelon a plainspan, which axe flags for review. Follow-up.